<template>
  <view class="body">
    <view
      class="loading_bg"
      :style="{
        backgroundImage: `url(${oss2('others/2023Q4Code/loading_bg.jpg')})`,
      }"
    >
      <view
        class="loading_gif"
        :style="{
          backgroundImage: `url(${oss2('others/2023Q4Code/loading_gif.gif')})`,
        }"
      >
      </view>
    </view>
  </view>
</template>
    
    <script setup>
import { oss2 } from "@/utils/utils";
import { onShow } from "@dcloudio/uni-app";

onShow(async () => {
  getApp().accessLogAdd();

  switch (true) {
    case uni.getLaunchOptionsSync().path === "campaign/pages/oreoQ4/webview":
      setTimeout(() => {
        getApp()
          .getUserInfo()
          .then((user) => {
            uni.redirectTo({
              url: `/campaign/pages/oreoQ4/webview?token=${uni.getStorageSync(
                "TOKEN"
              )}&openid=${uni.getStorageSync(
                "OPENID"
              )}&unionid=${uni.getStorageSync("UNIONID")}&memberid=${
                user.memberScore.memberId
              }&webSrc=${uni.getLaunchOptionsSync().query.webSrc}&shareTitel=${
                uni.getLaunchOptionsSync().query.shareTitel
              }&shareImg=${uni.getLaunchOptionsSync().query.shareImg}`,
            });
          });
      }, 1500);
      break;

    default:
      if (uni.getLaunchOptionsSync().query.from) {
        setTimeout(() => {
          uni.redirectTo({
            url:
              "/" +
              uni.getLaunchOptionsSync().path +
              "?from=" +
              uni.getLaunchOptionsSync().query.from,
          });
        }, 1500);
      } else {
        setTimeout(() => {
          uni.redirectTo({
            url: "/" + uni.getLaunchOptionsSync().path,
          });
        }, 1500);
      }

      break;
  }
});
</script>
    
    <style>
page {
  background-color: #040d30 !important;
}
</style>
    <style lang="less" scoped>
.body {
  width: 100%;
  min-height: 100vh;

  .loading_bg {
    width: 100%;
    height: 100vh;
    background-repeat: no-repeat;
    background-position: top left;
    background-size: 375px 812px;
    .loading_gif {
      width: 100%;
      height: 100vh;
      background-repeat: no-repeat;
      background-position: top left;
      background-size: 375px 812px;
    }
  }
}
</style>
    